package com.twu.biblioteca;

import static java.lang.String.format;

/**
 * Created with IntelliJ IDEA.
 * User: Thoughtworker
 * Date: 8/22/13
 * Time: 5:22 PM
 * To change this template use File | Settings | File Templates.
 */
public class Movie {
    private String name;
    private int year;
    private String director;
    private int rating;



    public Movie(String name, int year, String director, int rating) {
        this.name = name;
        this.year = year;
        this.director = director;
        this.rating = rating;
    }

    @Override
    public String toString() {
        if(rating == 0)
            return format("%-15s %-4d %-20s %-4s", name, year, director,"N/A");
        return format("%-15s %-4d %-20s %-4d", name, year, director, rating);
    }

    public String getName() {
        return name;
    }
}
